#ifndef HISTORYWINDOW_H
#define HISTORYWINDOW_H

#include <QDialog>
#include <QTableView>
#include <QPushButton>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QLabel>
#include <QSqlTableModel>
#include "database.h"

class HistoryWindow : public QDialog
{
    Q_OBJECT

public:
    explicit HistoryWindow(const QString &username, Database *db, QWidget *parent = nullptr);
    ~HistoryWindow();

private slots:
    void onCloseClicked();

private:
    void setupUI();
    void createConnections();
    void setupTableModel();

    QString username;
    Database *db;
    QTableView *historyTableView;
    QPushButton *closeButton;
    QSqlTableModel *historyModel;
};

#endif // HISTORYWINDOW_H 
